import React from 'react'
import { useSelector } from 'react-redux'

export default function CarList() {
  const { carList } = useSelector((state) => state.car)
  return (
    <div>
      <h2>购物车列表</h2>
      <ul>
        {carList.map((item) => {
          return (
            <li key={item.id}>
              {item.gname} : {item.gprice}:{item.buyNumber}
            </li>
          )
        })}
      </ul>
    </div>
  )
}
